<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>test dadalist</title>
    <script src="../style/js/jquery-3.4.1.min.js"></script>
</head>
<body>
<div>
    <input id="in1">
    <input id="in2" list="data">
    <datalist id="data">
        <option value="1">aaa</option>
        <option value="1">bbb</option>
        <option value="1">ccc</option>
        <option value="1">ddd</option>
    </datalist>
</div>
<script>
    console.log($('#in1').attr('list'));
    console.log($('#in2').attr('list'));
    $('#in1').on('change', function () {
        console.log(this)
    });
</script>
</body>
</html>